﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Markup;

namespace Kokomo.Environment.Commanding
{
	/// <summary>
	/// Represents a menu with items.
	/// </summary>
	public class MenuViewModel : MenuItemViewModel
	{
		/// <summary>
		/// Initializes a new instance of <see cref="MenuViewModel"/>.
		/// </summary>
		/// <param name="text">The text to display.</param>
		/// <param name="items">The items to display onthe menu.</param>
		/// <exception cref="ArgumentNullException"><paramref name="text"/> is <c>null</c>.</exception>
		public MenuViewModel(
			UiString text,
			IEnumerable<MenuItemViewModel> items
			)
		{
			if (text == null) throw new ArgumentNullException("text");

			this._text = text;
			this._items = items;
		}

		private UiString _text;
		/// <summary>
		/// Gets the text to display for the item.
		/// </summary>
		public override UiString Text
		{
			get { return this._text; }
		}

		/// <summary>
		/// Gets the icon to display for the item.
		/// </summary>
		/// <remarks>
		/// This implementation always returns <c>null</c>.
		/// </remarks>
		public override System.Windows.Media.ImageSource IconSource
		{
			get { return null; }
		}

		private IEnumerable<MenuItemViewModel> _items;
		/// <summary>
		/// Gets the items to display on the menu.
		/// </summary>
		public override IEnumerable<MenuItemViewModel> Items
		{
			get
			{
				return this._items;
			}
		}
	}
}
